# -*- coding: utf-8 -*-
"""
****************************
@Time    : 2021/4/28 15:13
@Author  : Candy
@File    : auth.py
****************************
"""
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

import datetime

from flask_sqlalchemy import SQLAlchemy
from sqlconfig import app

db = SQLAlchemy(app)


class AuthUrl(db.Model):
    __tablename__ = "auth"
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)  # 编号
    url = db.Column(db.String(64), nullable=False)
    level = db.Column(db.Integer, nullable=False, default=1)

    def __repr__(self):
        return 'AuthUrl(url:{}, level:{})'.format(self.url, self.level)


if __name__ == "__main__":
    db.drop_all()
    db.create_all()
